package com.seal.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.seal.comm.utils.Page;
import com.seal.dao.IBusiBarcodeDao;
import com.seal.dto.BusiBarcodeDto;
import com.seal.model.BusiBarcode;
import com.seal.service.IBusiBarcodeService;

@Service("busiBarcodeServiceImpl")
@Transactional(readOnly = true)
public class BusiBarcodeServiceImpl implements IBusiBarcodeService {

	@Resource(name = "busiBarcodeDaoImpl")
	private IBusiBarcodeDao busiBarcodeDao;

	@Transactional(propagation = Propagation.REQUIRED,readOnly = false, rollbackForClassName = "Exception")
	public void addBusiBarcode(BusiBarcode ca) throws Exception {
		busiBarcodeDao.addBusiBarcode(ca);
	}

	@Transactional(propagation = Propagation.REQUIRED,readOnly = false, rollbackForClassName = "Exception")
	public void updateBusiBarcode(BusiBarcode ca) throws Exception {
		busiBarcodeDao.updateBusiBarcode(ca);
	}

	public BusiBarcode getBusiBarcode(Long busiNo) throws Exception {
		return busiBarcodeDao.getBusiBarcode(busiNo);
	}

	public List<BusiBarcode> getAllBusiBarcode(BusiBarcodeDto dto, Page page)
			throws Exception {
		return busiBarcodeDao.getAllBusiBarcode(dto, page);
	}

	public List<BusiBarcode> getAllCompanyBusiBarcode(BusiBarcodeDto dto,
			Page page) throws Exception {
		return busiBarcodeDao.getAllCompanyBusiBarcode(dto, page);
	}
	
	public int getCountByStatus(BusiBarcodeDto dto,String status){
		return busiBarcodeDao.getCountByStatus(dto,status);
	}
}
